package com.etl.main;

import com.alibaba.fastjson.JSONObject;
import com.etl.http.HTTPClientUtil;
import com.etl.jdbc.jdbc.JDBCService;
import com.mongodb.util.JSON;

import java.io.IOException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Locker1995
 * Date: 2018-04-12
 * Time: 9:30 AM
 */
public class HTTPPostJson {

    public static void main(String[] args) throws IOException {

        String path = "http://zhouto-3-w7:8080/wiseForm-webapp/api/forminstance/p/update/1qUQ2V/l34b";

//        jsonObject.put("publishId","wsQn0q");
//        jsonObject.put("securityCode","Eh6k");

//        String jdbcurl= "jdbc:mysql://localhost:3306/mytest";
//
//        JDBCService jdbcService = new JDBCService(jdbcurl,"root","root","mysql");
//
//        List<JSONObject> data = jdbcService.findPageData("customer",1,1);
        String url= "jdbc:sqlserver://gdscuatdb;DatabaseName=GDSCUAT";

        JDBCService jdbcService = new JDBCService(url,"GDSCUATadmin","GDSCUATadmin","Sqlserver","GDSCUAT");

        List<JSONObject> data = jdbcService.findPageData("VIEW_MONGO",30,1);
//
        System.out.println(data.size());
//        for(int i = 0;i<data.size();i++){
//            JSONObject jsonObject = new JSONObject();
//            jsonObject.put("data",data.get(i));
//            System.out.println("i:"+i+"----"+jsonObject.toString());
//            System.out.println(HTTPClientUtil.doPostJson(path,jsonObject));
//
//        }

//        jsonObject.put("data",data.get(0));


//       System.out.println(data.get(0).toString());

    }

}
